package ru.mcfr.oxygen.updater.installer;

import ru.mcfr.oxygen.updater.utils.FileCommander;

import java.io.IOException;

public class FileInstaller extends AbstractInstaller{

    private String destinationMainPath = "";

    public FileInstaller(String path) {
        super(path);
        this.disabled = this.without_path;
    }

    //new FileInstaller("frameworks/mcfr")
    //new FileInstaller("plugins/EditorUtils")
    //new FileInstaller("plugins/UpdateManager")
    //install("/updates/1.0.111.0/frameworks/mcfr")
    //install("/updates/1.0.111.0/plugins/EditorUtils")
    //install("/updates/1.0.111.0/plugins/UpdateManager")
    @Override
    protected boolean install(String src) {
        try {
            FileCommander.copyDirectory(src, main_dir);
        } catch (IOException e) {
            e.printStackTrace();
            logger.error(e.getLocalizedMessage());
            return false;
        }
        return true;
    }


}
